import request from '@/utils/request'

// 获取资源列表
export const fetchResourceList = (params) => {
    return request({
        url: '/resource/list',
        method: 'get',
        params: params
    })
}

// 创建资源
export const createResource = (data) => {
    return request({
        url: '/resource/create',
        method: 'post',
        data: data
    })
}

// 更新资源
export const updateResource = (id, data) => {
    return request({
        url: '/resource/update/' + id,
        method: 'post',
        data: data
    })
}

// 删除资源
export const deleteResource = (id) => {
    return request({
        url: '/resource/delete/' + id,
        method: 'post'
    })
}

// 获取所有资源分类模块
export const fetchAllResourceList = () => {
    return request({
        url: '/resource/listAll',
        method: 'get'
    })
}
